//
//  MedicineModel.m
//  pocketmedicine
//
//  Created by student on 16/4/21.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "MedicineModel.h"

@implementation MedicineModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if(self)
    {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
    
}
+ (instancetype)medicineWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
    
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if([key isEqualToString:@"id"])
    {
        [self setValue:value forKey:@"medicineId"];
    }
    else if([key isEqualToString:@"description"])
    {
        [self setValue:value forKey:@"description1"];
    }
}


@end
